<?php $this->load->view('common/dpc-head');?>
<?php $this->load->view('common/dpc-header');?>
<h1 id="category-title" class="text-center" style="color:#F45435;text-shadow:2px 2px 2px #51245F;font-weight:400;"><?php echo $categoryArray[0]['category_name']; ?></h1>
<?php $this->load->view('common/dpc-top-search');?>
<div role="main">
            
            <div class="stripe-regular">
            
              <section id="category-info-box" class="company-box">
                <div class="row">
                  <div class="column">
                    <div class="wrapper-3 tertiary">
                      <div class="row collapse">
                        <div class="large-8 columns">
                          <div class="splitter-right">
                            <div class="inner">
                              <div class="row collapse">
                                <div class="large-4 columns">
                                  <figure id="category-image">
                                  	<?php if($categoryArray[0]['category_image']!=''){?>
                                  		<img src="<?php  echo $categoryArray[0]['category_image']; ?>" alt="<?php echo $categoryArray[0]['category_name']; ?>" style="box-shadow: 0px 0px 4px #A049BB;border-radius:3px;">
                                  	<?php }else{?>
                                    <img style="width:200px;height:110px;box-shadow: 0px 0px 4px #A049BB;border-radius:3px;" src="/public/images/store-img.png" alt="<?php echo $categoryArray[0]['category_name']; ?>">
                                    <?php }?>
                                  </figure>
                                </div>
                                <div class="large-8 columns">
                                  <div class="space-left">
                                    <h2 id="category-title" class="alt"><?php echo $categoryArray[0]['category_name']; ?> Promo Codes</h2>
                                    <div class="text-content">
                                      <p>
                                        <?php echo $categoryArray[0]['category_description']; ?>
                                      </p>
                                    </div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                        <div class="large-4 columns">
                          <div class="splitter-left">
                            <div id="category-store-count" class="inner dark-bg">
                              <div class="row">
                                <div class="large-6 columns text-center">
                                  <h3>Total Stores</h3>
                                </div>
                                <div class="large-6 columns">
                                  <div class="coupons-count">
                                    <p class="value primary"><?php echo count($childCatArray);?></p>
                                    <h4>Stores</h4>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                        <div style="clear:both;"></div>
                        <div style="width:100%;" id="child">
                         	<h5 id="top-stores-title" style="padding:0 0 0 10px;">Top Stores</h5>
                            <ul id="top-stores">
                            	<?php foreach($childCatArray as $temp){?>
                            		<li><a href="/<?php echo $temp['store_url'];?>-promo-codes"><?php echo $temp['store_name'];?></a></li>
                            	<?php }?>
                            	<div style="clear:both;height:5px;">&nbsp;</div>
                           	</ul>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </section>
            
              <div class="row">                
                
                <div class="large-9 columns">
                  <div id="cpnDiv">                  
                  <div id="category-top-coupons" class="coupons-wrapper">
                    <div class="row">
                      <div class="large-8 columns">
                        <h2 id="category-top-coupons-title">Top <a><?php echo $categoryArray[0]['category_name'];?></a> <span class="alt">Coupons</span></h2>
                      </div>
                      <div class="large-4 columns">
                      </div>
                    </div>
                    
                    <ul class="rr items-landscape">
                    <?php if(isset($catCouponArray) && !empty($catCouponArray)){ foreach($catCouponArray as $coupons){?>
                      <li class="wrapper-3">
                        <div class="row">
                          <div class="large-4 small-12 columns">
                            <figure><a href="/coupon.php/<?php echo $coupons['coupon_id']; ?>/<?php echo $coupons['store_id']; ?>" target="_blank" rel="nofollow">
                              <img src="
                              <?php if($coupons['coupon_image']!=''){ echo $coupons['coupon_image'];}else{ echo $coupons['store_image'];}?>
                              " alt="<?php echo $coupons['store_name'];?> promo codes" border="0" style="box-shadow: 0px 0px 2px #A049BB;border-radius:3px;"></a>
                            </figure>
                          </div>
                          <div class="large-5 small-8 columns">
                            <div class="col-middle" id="sec">
                              <h2 id="category-coupons-title" class="alt"><a href="/coupon.php/<?php echo $coupons['coupon_id']; ?>/<?php echo $coupons['store_id']; ?>" target="_blank" rel="nofollow"><?php echo $coupons['coupon_name'];?></a> - <span style="font-weight:normal;color:#0099FF;font-size:14px;"><?php echo $coupons['store_name'];?></span></h2>
                                <?php echo $coupons['coupon_description'];?>
                            </div>
                          </div>
                          <div class="large-3 small-4 columns">
                            <div class="col-right">
                              <p id="category-top-coupons-off" class="value secondary"><?php if($coupons['coupon_off_in']=='Percentage'){ echo $coupons['coupon_off_by'].' %';}else{ echo 'Rs '.$coupons['coupon_off_by'];}?> <?php if($coupons['coupon_offer_only']=='Yes'){ echo 'offer';}else{ echo 'off';}?></p>
                              <h6><?php echo $coupons['diff'];?> days left</h6>
                              <a href="/coupon.php/<?php echo $coupons['coupon_id']; ?>/<?php echo $coupons['store_id']; ?>" target="_blank" rel="nofollow" class="input button red secondary responsive">Show Coupon</a>
                            </div>
                          </div>
                        </div>
                      </li>
                    <?php }}?>
                    
                    <?php if(isset($catOfferArray) && !empty($catOfferArray)){ foreach($catOfferArray as $offer){ ?>
                    <li id="category-top-offers" class="wrapper-3">
                        <div class="row">
                          <div class="large-4 small-12 columns">
                            <figure><a href="/coupon.php/<?php echo $offer['coupon_id']; ?>/<?php echo $offer['store_id']; ?>" target="_blank" rel="nofollow">
                              <img src="
                              <?php if($offer['coupon_image']!=''){ echo $offer['coupon_image'];}else{ echo $offer['store_image'];}?>
                              " alt="<?php echo $offer['store_name'];?> offers" border="0" style="box-shadow: 0px 0px 2px #A049BB;border-radius:3px;"></a>
                            </figure>
                          </div>
                          <div class="large-5 small-8 columns">
                            <div class="col-middle" id="sec">
                              <h2 class="alt"><a href="/coupon.php/<?php echo $offer['coupon_id']; ?>/<?php echo $offer['store_id']; ?>" target="_blank" rel="nofollow"><?php echo $offer['coupon_name'];?></a> - <span style="font-weight:normal;color:#0099FF;font-size:14px;"><?php echo $offer['store_name'];?></span></h2>
                                <?php echo $offer['coupon_description'];?>
                            </div>
                          </div>
                          <div class="large-3 small-4 columns">
                            <div class="col-right">
                              <p class="value secondary"><?php if($offer['coupon_off_in']=='Percentage'){ echo $offer['coupon_off_by'].' %';}else{ echo 'Rs '.$offer['coupon_off_by'];}?> <?php if($offer['coupon_offer_only']=='Yes'){ echo 'offer';}else{ echo 'off';}?></p>
                              <h6><?php echo $offer['diff'];?> days left</h6>
                              <a href="/coupon.php/<?php echo $offer['coupon_id']; ?>/<?php echo $offer['store_id']; ?>" target="_blank" rel="nofollow" class="input button blue secondary responsive">Learn more</a>
                            </div>
                          </div>
                        </div>
                      </li>
                      <?php }}?>
                    </ul>
                  </div>
                  </div>
                </div>
                
                <aside class="large-3 columns main-sidebar">
                <?php if(isset($catBanners) && !empty($catBanners)){?>
                  <div id="banner" class="video-box small" style="margin:5px 0 10px 0;">
                    <a href="<?php echo $catBanners[0]['banner_link'];?>" target="_blank" rel="nofollow"><img src="<?php echo $catBanners[0]['banner_image'];?>" alt="<?php echo $catBanners[0]['banner_alt'];?>" border="0" /></a>
                  </div>
                <?php }?>
                  
                  <div class="testimonials-box flexslider" style="margin:0;">
                    <ul class="rr">
                      <li>
                        <div class="testimonial">
                          <div class="wrapper-5" id="catTag">
                          	<h3>Related Categories</h3>
                          	<ul id="related-categories">
                          	<?php foreach($relatedCat as $other){ if($other['category_id']!=$categoryArray[0]['category_id']){?>
                          		<li>
                          			<a href="/<?php echo $other['parent_url'].'/'.$other['category_url'];?>"><?php echo $other['category_name'];?></a>
                          		</li>
                          	<?php }}?>
                          	<div style="clear: both;"></div>
                          	</ul>
                          </div>
                        </div>
                      </li>
                    </ul>
                  </div>
                
                </aside>
              </div>
            </div>
            
          </div>
<?php $this->load->view('common/dpc-footer');?>
